<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="ko">
<head>
	<%@ include file="/include/header.jsp" %>
	<link rel="stylesheet" href="<%=cp %>/css/board.css">
	<%@ include file="/include/commonRes.jsp" %>
	<script type="text/javascript">
		$(function(){
			
			$("input[name='chk_wr_id']").click(function(){
				var allcnt=$("input[name='chk_wr_id']").size();
				var chkcnt=$("input[name='chk_wr_id']:checked").size();
				
				var chkall=$("#chkall");
				
				if(chkcnt==allcnt){
					chkall.attr("checked","checked");
				} else{
					chkall.removeAttr("checked");
				}
			});
			
			$("#wr_delete").click(function(){
				var chk_contents=$("input[name='chk_wr_id']:checked");
				var chkArr=new Array();
				
				if(chk_contents.size()<=0){
					alert("삭제할 글을 선택하여주세요.");
					return false;
				}			
				for(var seq=0;seq<chk_contents.size();seq++){
					var chk_content=chk_contents[seq].value

					chkArr.push(chk_content);
				}
				
				var paramData={"deleteList":chkArr.toString()};
				
				var success=function(data){
					if(data.resultCode=="0000"){
						alert("삭제 처리가 정상적으로 적용 되었습니다.");
					} 
					location.reload();
				}
				var error=function(xhr,error,response){
					alert("시스템 오류입니다. 다시 시도해주세요.");
				}
				var dataType="json";
				var type="POST";
				var url="<%=cp%>/notice_delete.do";
				sendAjax(type,dataType,url,paramData,success,error);
				
				
				return false;
			});
			
			$("#chkall").click(function(){
				var isChk=$(this).is(":checked");
				var chk_wr_id=$("input[name='chk_wr_id']");
				
				if(isChk) {
					chk_wr_id.attr("checked","checked");
				} else {
					chk_wr_id.removeAttr("checked");
				}
			});
		});
	</script>
</head>
<body>
<div id="hd_login_msg">최고관리자 최고관리자님 로그인 중 <a href="http://mkis.fieram.gethompy.com/bbs/logout.php">로그아웃</a></div>

<%@include file="/include/mainMenuHeader.jsp" %>
<div id="wrapper">
	<h2 id="container_title">공지 사항<span class="sound_only"> 목록</span></h2>
	
	
	<div id="bo_list">
		<nav id="bo_cate">
	    	<h2>공지 사항 카테고리</h2>
	    	<ul id="bo_cate_ul">
           		<li>
					<a href="#" <c:if test="${empty dept }">class="blackBold"</c:if>>전체</a>
				</li>
				<li>
					<a href="#" <c:if test="${dept=='1' }">class="blackBold"</c:if>>공고</a>
				</li>
				<li>
					<a href="#" <c:if test="${dept=='2' }">class="blackBold"</c:if>>병원관련</a>
				</li>
				<li>
					<a href="#" <c:if test="${dept=='3' }">class="blackBold"</c:if>>진료관련</a>
				</li>
				<li>
					<a href="#" <c:if test="${dept=='4' }">class="blackBold"</c:if>>아이디어</a>
				</li>        
			</ul>
	    </nav>
	    
	    <div class="bo_fx">
	    	
	    	<div id="bo_list_total">
	            <span>Total ${totalcnt }건</span>${page }페이지
	        </div>
			<div class="right_align_area">
	            <input type="button" value="직원등록" class="btn_reg" id="emp_regist" />
	        </div>
	        <!-- list -->
		    <div class="tbl_head01 tbl_wrap">
		        <div class="notice_li_table">
					<ul class="subject th">
						<li class="col chk_area"><input type="checkbox" id="chkall"></li>
						<li class="num_area">번호</li>
						<li class="title_area">제목</li>
						<li class="regdate_area">작성일</li>
					</ul>
					<c:if test="${empty list }">
						<ul class="content">
							<li class="emptyList">목록이 없습니다.</li>
						</ul>
					</c:if>
					<c:if test="${not empty list }">
						<c:forEach var="item" items="${list}">
							<ul class="content">
								<li class="col font11 chk_area"><input type="checkbox" name="chk_wr_id" value="${item.boardSeq }" /></li>
								<li class="col font11 num_area">${item.row }<c:if test="${empty item.row}">&nbsp;</c:if></li>
								<li class="font11 name_area">
									<a href="#" onclick="view('${item.boardSeq}')"> 
										${item.board_title}<c:if test="${empty item.board_title}">&nbsp;</c:if>
									</a>
								</li>
								<li class="font11 dept_area">${item.regDate}<c:if test="${empty item.regDate}">&nbsp;</c:if></li>
 							</ul>
						</c:forEach>
					</c:if>
				</div>
		    </div>
	    
	    
	    </div>





		<!-- 검색조건 -->
		<fieldset id="bo_sch">
		    <legend>게시물 검색</legend>
		
		    <form name="fsearch" method="get">
		    <input type="hidden" name="bo_table" value="job_daily">
		    <input type="hidden" name="sca" value="">
		    <input type="hidden" name="sop" value="and">
		    <label for="sfl" class="sound_only">검색대상</label>
		    <select name="sfl">
		        <option value="wr_subject">제목</option>
		        <option value="wr_content">작성일</option>
		    </select>
		    <input name="stx" value="" placeholder="검색어(필수)" required="" id="stx" class="required frm_input" size="15" maxlength="15">
		    <input type="submit" value="검색" class="btn_submit">
		    </form>
		</fieldset>
		
	</div>
	<%@ include file="/include/pageInc.jsp"%>
</div>
<%@ include file="/include/footer.jsp" %>

</body>
</html>